/**
 * Created by zhaofei on 2017/5/8.
 */

import java.io.IOException;
import java.io.Reader;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
public class GetSession {
    public static SqlSession getSqlSession() {
        String resource = "web/sankuai/order/configuration.xml";
        SqlSession session = null;
        try {
            Reader reader = Resources.getResourceAsReader(resource);
            SqlSessionFactory ssf = new SqlSessionFactoryBuilder().build(reader);
            session = ssf.openSession();
        }
        catch (Exception e) {
            System.out.println(e);

        }
        return session;
        }
    };
